package com.nvwa.mvp.validated.controller;

import com.nvwa.dto.resp.Response;
import com.nvwa.mvp.validated.form.UserForm;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ValidController 类。
 *
 * @author wangjing
 * @date 2024-12-27 [wangjing] 创建。
 */
@RestController
@RequestMapping("/valid")
public class ValidController {
    @PostMapping("/test")
    public Response test(@Validated @RequestBody UserForm userForm) {
        return Response.success();
    }

    @PostMapping("/ne")
    public Response ne(@RequestBody UserForm userForm) {
        System.out.println(10 / 0);
        return Response.success();
    }
}
